﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Globalization;
using System.Text;
using System.Windows.Forms;

namespace Compiler.LabForms
{
    public partial class ResultsForm : Form
    {
        public ResultsForm()
        {
            InitializeComponent();
        }

        private void ResultsForm_Load(object sender, EventArgs e)
        {
            surnameLabel.Text = Lab.GetLab().Surname;
            nameLabel.Text = Lab.GetLab().Name;
            groupLabel.Text = Lab.GetLab().Group;

            if (Lab.GetLab().TestComplete)
            {
                testComplete.Text = @"Завершено";
                testComplete.ForeColor = Color.ForestGreen;
            }
            else
            {
                testComplete.Text = @"Незавершено";
                testComplete.ForeColor = Color.DarkRed;
            }
            testLabel.Text = Lab.GetLab().TestCorrectAnswers.ToString(CultureInfo.InvariantCulture)
                             + @"(" + Lab.GetLab().TestCorrectPercentage.ToString(CultureInfo.InvariantCulture) + @"%)";

            if (Lab.GetLab().StaticComplete)
            {
                staticComplete.Text = @"Завершен";
                staticComplete.ForeColor = Color.ForestGreen;
            }
            else
            {
                staticComplete.Text = @"Незавершен";
                staticComplete.ForeColor = Color.DarkRed;
            }
            staticLabel.Text = Lab.GetLab().StaticMistakes.ToString(CultureInfo.InvariantCulture);

            if (Lab.GetLab().LexicalComplete)
            {
                lexicalComplete.Text = @"Завершен";
                lexicalComplete.ForeColor = Color.ForestGreen;
            }
            else
            {
                lexicalComplete.Text = @"Незавершен";
                lexicalComplete.ForeColor = Color.DarkRed;
            }
            lexicalLabel.Text = Lab.GetLab().LexicalMistakes.ToString(CultureInfo.InvariantCulture);

            if (Lab.GetLab().SyntaxComplete)
            {
                syntaxComplete.Text = @"Завершен";
                syntaxComplete.ForeColor = Color.ForestGreen;
            }
            else
            {
                syntaxComplete.Text = @"Незавершен";
                syntaxComplete.ForeColor = Color.DarkRed;
            }
            syntaxLabel.Text = Lab.GetLab().SyntaxMistakes.ToString(CultureInfo.InvariantCulture);

            if (Lab.GetLab().GenerationComplete)
            {
                generationComplete.Text = @"Завершена";
                generationComplete.ForeColor = Color.ForestGreen;
            }
            else
            {
                generationComplete.Text = @"Незавершена";
                generationComplete.ForeColor = Color.DarkRed;
            }
            generationLabel.Text = Lab.GetLab().GenerationMistakes.ToString(CultureInfo.InvariantCulture);
        }
    }
}
